package com.jie.other.jetpack.flow

import androidx.lifecycle.ViewModel
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.flow

class MainViewModel : ViewModel() {

    val timFlow  = flow {
        var time = 0
        while(time < 1000) {
            emit(time)
            delay(1000)
            time ++
        }
    }

}